﻿<Page x:Class="CentroVentas.Forms.Compras.FrmListarCompras"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
      mc:Ignorable="d" 
      Background="#ECF5EB"
      d:DesignHeight="300" d:DesignWidth="300"
      Title="FrmListarCompras"
      Loaded="Page_Loaded">
    <ScrollViewer>
        <extToolkit:BusyIndicator Name="Busy"
                                  IsBusy="False"
                                  BusyContent="Espere...">
            <StackPanel Orientation="Vertical">
                <Grid>
                    <TextBlock Text="Compras"
                               FontSize="24"
                               Margin="0,10,20,0"
                               HorizontalAlignment="Right" />
                </Grid>
                <Grid>
                    <GroupBox Header="Compras realizadas">
                        <StackPanel Orientation="Vertical">
                            <extToolkit:WatermarkTextBox Name="txtBuscar"
                                                         Watermark="Escriba para buscar"
                                                         TextChanged="txtBuscar_TextChanged"
                                                         Margin="5"/>
                            <CheckBox Name="chkVisible"
                                      Content="Ver solo compras finalizadas" 
                                      Click="chkVisible_Click" Checked="chkVisible_Checked" />
                            <DataGrid Name="Grilla"
                                      Height="400"
                                      Margin="5"
                                      ItemsSource="{Binding}"
                                      CanUserAddRows="False"
                                      CanUserDeleteRows="False"
                                      CanUserReorderColumns="False"
                                      CanUserResizeColumns="False"
                                      IsReadOnly="True"
                                      SelectionMode="Single"
                                      SelectionUnit="FullRow">
                                <DataGrid.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="Ver detalle compra"
                                                  Name="MenuDetalleCompra"
                                                  Click="MenuDetalleCompra_Click" />

                                        <MenuItem Header="Confirmar compra"
                                                  Name="ConfirmarCompra"
                                                  Click="ConfirmarCompra_Click"/>
                                        <MenuItem Header="Cancelar compra"
                                                  Name="CancelarCompra"
                                                  Click="CancelarCompra_Click" />
                                    </ContextMenu>
                                </DataGrid.ContextMenu>
                            </DataGrid>
                        </StackPanel>
                    </GroupBox>
                </Grid>
            </StackPanel>
        </extToolkit:BusyIndicator>
    </ScrollViewer>
</Page>
